# Contributor: Vladimir Luzan <vluzan@disroot.org>
# Maintainer: Vladimir Luzan <vluzan@disroot.org>
pkgname=qt5ct
pkgver=1.5
pkgrel=0
pkgdesc="Qt5 configuration tool"
url="https://sourceforge.net/projects/qt5ct/"
arch="all"
license="BSD-2-Clause"
makedepends="cmake qt5-qtbase-dev qt5-qttools-dev"
source="https://sourceforge.net/projects/qt5ct/files/qt5ct-$pkgver.tar.bz2"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
fc16c7849a89aa8ee9480162888294638bc01f83b89d86c978397e58f6da4360cf07b9f558635b8a5b13bd10d18f3ad49663fe8a76183da9ae55aac23230b1e5  qt5ct-1.5.tar.bz2
"
